import request from '@/utils/request.js'

const prefix = '/api/courseOrder'

// 课程卡订单列表
export function courseOrderList(params) {
	return request({
		url: prefix + '/list',
		method: 'get',
		params: params
	})
}

// 课程订单信息
export function courseOrderInfo(id) {
	return request({
		url: prefix + '/info/' + id,
		method: 'get'
	})
}
// 课程订单信息 订单号
export function courseOrderNoInfo(orderNo) {
	return request({
		url: prefix + '/infoByOrderNo/' + orderNo,
		method: 'get'
	})
}

//订单是否支付成功
export function isPaySuccess(orderNo) {
	return request({
		url: prefix + '/isPaySuccess/' + orderNo,
		method: 'get'
	})
}

/**
 * @param {Object} orderNo
 * 取消订单
 */
export function cancelPay(orderNo) {
	return request({
		url: prefix + '/cancelPay/' + orderNo,
		method: 'post'
	})
}